<template>
  <div id="app">
    <!-- <img alt="Vue logo" src="./assets/logo.png"> -->
    <h1>父组件中接收到的数据：{{ childData }}</h1>
    <HelloWorld msg="啦啦啦 啦啦啦 啦啦噜啦啦" :count="parentCount" @child-count-change="handler" />
    <HelloWorld>
      <p>aaaa</p>
      <h3>asdfhkjashdfj</h3>
    </HelloWorld>
    <HelloWorld>
      <!-- 简写：#footer -->
      <template #header>mankiw header</template>
      <template v-slot:footer="dataObj" >mankiw footer:{{ dataObj.childCount }}</template>
    </HelloWorld>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  data() {
    return {
      parentCount: 1000,
      childData: 0
    }
  },
  methods: {
    handler(childCount) {
      this.childData = childCount
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
